require(['config'], () => {
  require(['jquery', 'include'], ($) => {
    class LoginPage {
      constructor() {
        this.bindEventListener()
      }

      bindEventListener() {
        $('.btn-login').on('click', () => {
          const _username = $('.username').val(), _password = $('.password').val()
          $.ajax({
            url: 'http://localhost:3000/login.do',
            method: 'POST',
            data: {
              username: _username,
              password: _password
            },
            success: resData => {
              console.log('成功：', resData)
            }
          })
        })
      }
    }

    new LoginPage()
  })
})